package imnu.work.imnu0714_work02.work_2;

/**
 * @author: lys
 * @类名: Rectangle
 * @Title:
 * @date: 2020/7/14
 **/
public class Rectangle {
    private int length;
    private int width;

    public Rectangle(){}

    public Rectangle(int length, int width){
        this.length = length;
        this.width = width;
    }

    public int getLength() {
        return length;
    }

    public void setLength(int length) {
        this.length = length;
    }

    public int getWidth() {
        return width;
    }

    public void setWidth(int width) {
        this.width = width;
    }

    //求面积
    public int getArea(){
        return length * width;
    }
    //求周长
    public int getPer(){
        return (length + width)*2;
    }
    //打印
    public void show(){
        System.out.println("长："+length);
        System.out.println("宽："+width);
        System.out.println("面积："+getArea());
        System.out.println("周长："+getPer());
    }

}
